package util.chessworld.util;

public class Dot {

    private int X;
    private int Y;

    public Dot(int X, int Y) {
        this.X = X;
        this.Y = Y;
    }

    public Dot copy() {
        return new Dot(this.X, this.Y);
    }

    @Override
    public String toString() {
        return "(" + X + "," + Y + ")";
    }

    public void setX(int X) {
        this.X = X;
    }

    public void setY(int Y) {
        this.Y = Y;
    }

    public int X() {
        return X;
    }

    public int Y() {
        return Y;
    }

    @Override
    public boolean equals(Object objet) {
        if (objet == this) {
            return true;
        }
        if (objet instanceof Dot) {
            Dot p = (Dot) objet;
            if ((X != p.X) | (Y != p.Y)) {
                return false;
            } else {
                return true;
            }
        }
        return false;
    }

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 47 * hash + this.X;
        hash = 47 * hash + this.Y;
        return hash;
    }
}
